package com.wawayaya.bean;


import org.json.JSONObject;

/**
 * Created by creative on 15/7/6.
 */
public class Notice implements Cloneable{

    private  Long       noticeId;
    private  Integer   noticeType;    // 1弹出网页  2 弹出窗口 3 强制更新 4 推荐更新
    private  String    noticeMemo;
    private  String    noticeContent;

    public Notice() {

    }
    public Notice(Long noticeId, Integer noticeType, String noticeMemo, String noticeContent) {
        this.noticeId = noticeId;
        this.noticeType = noticeType;
        this.noticeMemo = noticeMemo;
        this.noticeContent = noticeContent;
    }
    public Object clone() {
        Notice o = null;
        try {
            o = (Notice) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return o;
    }

    public Long getNoticeId() {
        return noticeId;
    }

    public void setNoticeId(Long noticeId) {
        this.noticeId = noticeId;
    }

    public Integer getNoticeType() {
        return noticeType;
    }

    public void setNoticeType(Integer noticeType) {
        this.noticeType = noticeType;
    }

    public String getNoticeMemo() {
        return noticeMemo;
    }

    public void setNoticeMemo(String noticeMemo) {
        this.noticeMemo = noticeMemo;
    }

    public String getNoticeContent() {
        return noticeContent;
    }

    public void setNoticeContent(String noticeContent) {
        this.noticeContent = noticeContent;
    }

    public  Notice  jsonToVO(JSONObject json){
        setNoticeId(json.optLong("noticeId"));
        setNoticeType(json.optInt("noticeType"));
        setNoticeMemo(json.optString("noticeMemo"));
        setNoticeContent(json.optString("noticeContent"));
        return this;
    }

    @Override
    public String toString() {
        return "Notice{" +
                "noticeId=" + noticeId +
                ", noticeType=" + noticeType +
                ", noticeMemo='" + noticeMemo + '\'' +
                ", noticeContent='" + noticeContent + '\'' +
                '}';
    }
}
